var _mm = require('util/mm.js');

var _admin = {
    // login
    login: function(formData, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/admin/Teacherlib/login.do'),
            data: formData,
            method: 'post',
            success: resolve,
            error: reject
        });
    },
    //后台登出
    logout: function(resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/Teacherlib/logout.do'),
            method: 'post',
            success: resolve,
            error: reject
        });
    },
    // 获取后台列表
    searchWorkTrend: function(listParam, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/admin/Worktrend/search.do'),
            data: listParam,
            method: 'post',
            success: resolve,
            error: reject
        });
    },
    selectOrState: function(wtId, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/admin/Worktrend/state.do'),
            data: wtId,
            method: 'post',
            success: resolve,
            error: reject
        });
    },
    searchInteraction: function(wtId, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/admin/Communication/list.do'),
            data: wtId,
            method: 'post',
            success: resolve,
            error: reject
        });
    },
    //师资库列表后台
    searchTeacherlib: function(wtId, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/admin/TeacherManager/list.do'),
            data: wtId,
            method: 'post',
            success: resolve,
            error: reject
        });
    },
    //培训通知列表
    searchTraining: function(wtId, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/admin/Pxtonzhi/list.do'),
            data: wtId,
            method: 'post',
            success: resolve,
            error: reject
        });
    },
    //培训通知已经关闭的报名
    searchTrainingClose: function(wtId, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/admin/Pxtonzhi/close_list.do'),
            data: wtId,
            method: 'post',
            success: resolve,
            error: reject
        });
    },
    //待报名培训通知
    searchOperation :function(wtId, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/admin/Workbench/pxtonzhibench_list.do'),
            data: wtId,
            method: 'post',
            success: resolve,
            error: reject
        });
    },
    //新建培训通知
    savePxtonzhi: function(userInfo, resolve, reject) {
        _mm.request({
            url: _mm.getServerUrl('/admin/Workbench/savetrainingInform.do'),
            data: userInfo,
            method: 'post',
            success: resolve,
            error: reject
        });
    },
}
module.exports = _admin;